package customer.zspt.cn.customer.components.chat.ChatOtherThingContent;


import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;

import customer.zspt.cn.customer.R;

/**
 * Created by Administrator on 2018/7/24 0024.
 */

public class ChatArticleContent extends Activity {

    @ViewInject(R.id.content_wb)
    private WebView content_wb;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.chat_article_content);
        ViewUtils.inject(this);
        String article_contentUrl = getIntent().
                getStringExtra("article_contentUrl");
        WebSettings settings = content_wb.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setBuiltInZoomControls(true);//支持缩放
        content_wb.setWebViewClient(new WebViewClient(){
            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
            }

            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                super.onPageStarted(view, url, favicon);
            }

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                content_wb.loadUrl(url);
                return true;
            }
        });
        content_wb.loadUrl(article_contentUrl);
    }
}
